package com.stark.exp.autoconfig.config;

import com.stark.exp.autoconfig.MyCommandLineRunner;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;

@EnableConfigurationProperties(MyProperties.class)
public class AutoConfig {

    @Bean
    @ConditionalOnProperty(prefix = "stark.auto", name="enable")
    CommandLineRunner createMyCommandLineRunner(Environment env){
        return new MyCommandLineRunner(env);
    }

}
